package com.doctor.windflower_doctor.activity;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.doctor.windflower_doctor.R;
import com.doctor.windflower_doctor.SystemApplication;
import com.doctor.windflower_doctor.view.RoundedImageView;
import com.lidroid.xutils.BitmapUtils;
import com.nostra13.universalimageloader.core.DisplayImageOptions;

public class QrCodeActiviy extends BaseActivity {
	private TextView tv_title, tv_name;
	private ImageView iv_backs, iv_qr;
	private String img, name, imgurl;
	private RoundedImageView iv_user;
	private DisplayImageOptions options;

	@Override
	protected void getSaveData(Bundle savedInstanceState) {
		// TODO Auto-generated method stub

	}

	@Override
	protected void processLogic() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void setListener() {
		// TODO Auto-generated method stub
		iv_backs.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				finish();
			}
		});
	}

	@Override
	protected void findViews() {
		// TODO Auto-generated method stub
		options = new DisplayImageOptions.Builder()
				.showImageOnLoading(R.drawable.loading_img)
				.showImageOnFail(R.drawable.list_default_icon)
				.showImageForEmptyUri(R.drawable.list_default_icon)
				.cacheInMemory(true).cacheOnDisk(true)
				.bitmapConfig(Bitmap.Config.ARGB_8888).build();
		tv_title = (TextView) findViewById(R.id.textView);
		iv_qr = (ImageView) findViewById(R.id.imageView2);
		tv_name = (TextView) findViewById(R.id.tv_name);
		iv_user = (RoundedImageView) findViewById(R.id.imageView1);
		tv_title.setText("二维码名片");
		iv_backs = (ImageView) findViewById(R.id.back_btn);
		img = getIntent().getStringExtra("img");
		name = getIntent().getStringExtra("name");
		imgurl = getIntent().getStringExtra("imgurl");
		SystemApplication.getInstance().mImageLoad1.displayImage(imgurl, iv_user,
				options);
		BitmapUtils bmps = new BitmapUtils(this);
		bmps.display(iv_qr, img);
		tv_name.setText(name);
	}

	@Override
	public int getResLayoutId() {
		// TODO Auto-generated method stub
		return R.layout.activity_code;
	}

}
